import {createRouter, createWebHashHistory} from "vue-router"
import HomeView from "../views/HomeView.vue"

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: "/home",
    },
    {
      path: "/home",
      name: "home",
      component: HomeView,
      meta: {showTabbar:true}
    },
    {
      path: "/classify",
      name: "classify",
      component: () => import("../views/ClassifyView.vue"),
      meta: {showTabbar:true}
    },
    {
      path: "/cart",
      name: "cart",
      component: () => import("../views/CartView.vue"),
      meta: {showTabbar:true},
      children: [
        {
          path: "settle",
          component: () => import("../views/SettleView.vue"),
          meta: {showTabbar:false}
        }
      ]
    },
    {
      path: "/mine",
      name: "mine",
      component: () => import("../views/MineView.vue"),
      meta: {showTabbar:true}
    },
    {
      path: "/login",
      name: "login",
      component: () => import("../views/LoginView.vue"),
      meta: {showTabbar:false}
    },
    {
      path: "/detail/:id",
      name: "detail",
      component: () => import("../views/DetailView.vue"),
      meta: {showTabbar:false}
    },
  ]
})

export default router